<%-- 

 Copyright [2011] [Marco Berri marcoberri@gmail.com]

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and limitations under the License.

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>

    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>MBfASTuRL</title>

		<meta name="description" content="generazione url brevi, app in java" />

		<meta name="keywords" content="java,url,web,app,short url,url brevi" />

		<style type="text/css">

			body,p,div,h1,h2,h3{
				margin:0;
				padding:0;
			}

			h1{text-decoration:underline;}

			a,h1,h2,h3{color:#cc3300;}

			body{
				font-family:Verdana,Arial,Helvetica,sans;
				font-size:12px;
				background-image: url("img/pattern.gif");
			}

			ul{list-style-image:url("img/liststyleimage.png");}
			.wrapper{
				 margin:40px 80px;
			}

			.header,.welcome{
				margin: 20px 0;
			}

			.form-container{
				width:500px;
				padding: 20px 20px 30px 50px;
				margin-bottom:30px;
				border:2px solid black;
				background: #eeeeee;
			}

			.footer{
				padding-bottom:40px;
				font-size:20px;
			}

		</style>

        <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>

		<script type="text/javascript" language="JavaScript">

			function submit_this(){

			$.ajax({
			  url: "s?url=" + encodeURIComponent($('#url').attr('value')) + "&unique=" + $('#unique').attr('value') + "&type=" + $('#type').attr('value'),

			   success: function(data) {
			     var jData = $( data );
			     var jShort = jData.find("short");
			     var jQrcode = jData.find("qrcode");

			    $('#result').attr('value',jShort.text());
			    $('#qrcode').attr('value',jQrcode.text());
			    $('#calling').attr('value', ("s?url=" + encodeURIComponent($('#url').attr('value')) + "&unique=" + $('#unique').attr('value') + "&type=" + $('#type').attr('value')) );
			   }
			});
			}
    	</script>

   		</head>

    	<body>

        	<div class="wrapper">

        		<div class="header">
        			<h1>MBFastUrl</h1>
	            </div>

	            <img src="http://dev.doctor-groove.it/q/0p"/>

	         	<br />

        		<div class="welcome">
            		<h2>Benvenuti sul sito di MbFastUrl</h2>
            		<br/>
           			il progetto è disponibile in forma sorgente a <a href="http://dev.doctor-groove.it/r/9i">questo</a> indirizzo con relativa <a href="http://dev.doctor-groove.it/r/e7">documentazione</a> e <a href="http://dev.doctor-groove.it/r/8w">sorgenti</a><br/><br/>

            	</div>

				<div class="form-container">

					<h3>Genera il tuo Url Breve</h3>
            		<br/>

    				<form method="post">

				        <input id="type" type="hidden" name="type" value="xml"/>
				        <input id="unique" type="hidden" name="unique" value="false"/>

						<div>
				            <b>Url:</b><br />
				            <input id="url" style="width: 450px;"  type="text" name="url" value="http://www.doctor-groove.it"/><input type="button" onclick="submit_this()" value="Genera Url Breve"/>
						</div>

			        	<br />

			            <div>
							<b>Chiamata:</b><br />
							<input type="text" style="width: 450px;" id="calling" name="calling" />
						</div>

						<br />


						<div>
			           		<b>qrcode:</b><br />
			           		<input type="text" style="width: 450px;" id="qrcode" name="qrcode" />

            			            </div>
                                                <br />
                                                
						<div>
							<b>Risultato</b><br />
							<input type="text" style="width: 450px;" name="result" id="result"/>
						</div>




    				</form>

    			</div>

	       		<h3>Statistiche </h3>

		        <ul>
		            <li>Per le statistiche di utilizzo del vostro url generato dovete richiamare questo url dev.doctor-groove.it/stats/one?url=xxxx dove xxx è uguale al vostro short url es: /r/p</li>
		            <li>Statistiche di visualizzazione <a href="/stats/all">distinte</a> per url </li>
		            <li>Log statistiche <a href="/stats/log?table=view">totali</a> delle view</li>

		            <li>Log statistiche <a href="/stats/log?table=save">totali</a> delle save</li>
		            <li>Elenco User-Agent <a href="/stats/ua">chiamanti</a> nelle view</li>
		            <li>Elenco Referer <a href="/stats/referer">chiamanti</a> nelle view</li>

		        </ul>

				<br />

  				<h3>Log della App</h3>

		        <ul>
		            <li> <a href="/log/all">App</a></li>
		            <li> <a href="/log/cron">Cron</a></li>
		        </ul>


				<br/><br/>

   		 		<div class="footer">

	   		 		<a href="mailto:marcoberri@gmail.com">scrivetemi!</a>

	   		 		<br/><br/>

	   		 		<a href="http://dev.doctor-groove.it/r/49">M.Berri</a>

   		 		</div>

   		 	</div>

	</body>

</html>